package br.org.credfaz.apaga.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import br.org.credfaz.apaga.factory.ConnectionFactory;

public class TelefoneClienteDAO {

	private final Connection connection;

	public TelefoneClienteDAO() {
		try {
			connection = new ConnectionFactory().getConnection();
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}

	public void apaga() {
		String sql = "delete from telefonecliente";
		PreparedStatement stmt;
		try {
			stmt = connection.prepareStatement(sql);
			stmt.execute();

		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
	
	public void apagaExtrato() {
		String sql = "delete from extcontacorrente";
		PreparedStatement stmt;
		try {
			stmt = connection.prepareStatement(sql);
			stmt.execute();

		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}

}
